<%@page import = "java.util.Iterator"%>
<%@page import = "java.util.ArrayList"%>
<%@ page language = "java" contentType = "text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
	<%@taglib uri = "/WEB-INF/tld/struts-html.tld" prefix = "html" %>
	<%@taglib uri = "/WEB-INF/tld/struts-bean.tld" prefix = "bean" %>
    <script src = "js/jscal2.js"></script>
    <script src = "js/en.js"></script>
    <link rel = "stylesheet" type = "text/css" href = "css/jscal2.css" />
    <link rel = "stylesheet" type = "text/css" href = "css/border-radius.css" />
    <link rel = "stylesheet" type = "text/css" href = "css/steel.css" /> 
	<meta http-equiv = "Content-Type" content = "text/html; charset=ISO-8859-1">
	<link rel = "stylesheet" type = "text/css" href = "css/profile.css" />
</head>
<body>
	<%
	if(session.getAttribute("emailId")==null)
		response.sendRedirect("index.jsp");
	else {
		ArrayList userDetails = (ArrayList)request.getAttribute("userDetails");
		Iterator itr = userDetails.iterator();
		System.out.println("size = "+userDetails.size() );
		while(itr.hasNext()) {
			String email = itr.next().toString();
			String name = itr.next().toString();
			String date_of_birth = itr.next().toString();
			String contact_number = itr.next().toString();
			String project_name = itr.next().toString();
			String designation = itr.next().toString();
			String gender = itr.next().toString();
	%>
	<!-- this form is used to update for user-profile.. -->
	<html:form action = "UpdateProfile" method = "post">
		&nbsp;&nbsp;<h1><font color = "#FF6633"> Update Profile..</font></h1>	
		<table id = "profile_detail"  cellpadding = "5" cellspacing = "10">
			<tr>
				<td align = "left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.email" /></td>
				<td align = "left">
					<html:text property = "email" styleClass = "txtfields" value = "<%=email%>" ></html:text></td>
				<td align = "left"> 
					<html:errors property = "email"></html:errors>
				</td>
			</tr>
			<tr>
				<td align = "left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.name" /></td>
				<td align = "left">
					<html:text property = "name" styleClass = "txtfields" value = "<%=name %>" ></html:text></td>
					<td align = "left"> 
					<html:errors property = "name"></html:errors>
				</td>
			</tr>
			<tr>
				<td align = "left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.date_of_birth" /></td>
				<td align = "left">
					<input size = "30" id = "f_date1" value = "<%=date_of_birth %>" name = "dob" readonly = "readonly" />	</td>
				<td align = "left">
					<button id = "f_btn1"></button><br />
					<script type = "text/javascript">//<![CDATA[
						Calendar.setup({
						inputField : "f_date1",
						trigger    : "f_btn1",
						onSelect   : function() { this.hide()},
						showTime   : 12,
						dateFormat : "%Y-%m-%d"
						});
						//]]>
					</script>
					<html:errors property = "dob" />
				</td>
			</tr>
			<tr>
				<td  align = "left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.contact_number" /></td>
				<td align = "left">
					<html:text property = "contact_number" styleClass = "txtfields" value = "<%=contact_number %>"></html:text></td>
					<td align = "left"> 
					<html:errors property = "contact_number"></html:errors>
				</td>
			</tr>
			<tr>
				<td align = "left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.project_name" /></td>
				<td align = "left">
					<html:text property = "project_name" styleClass = "txtfields" value = "<%=project_name %>"></html:text></td>
				<td align = "left">
					<html:errors property = "project_name"></html:errors>
				</td>
			</tr>
			<tr>
				<td align  ="left" class = "field"><bean:message key = "MetaConnect.UpdateProfile.designation" /></td>
				<td align = "left">
					<html:text property = "designation" value = "<%=designation %>" ><font size="+2" >Male</font></html:text>
					<td align = "left"> 
					<html:errors property = "designation"></html:errors>
				</td>
			</tr>
			<tr>
				<td></td>
				<td colspan = "2">
					<html:submit value = "Save" styleClass = "button"></html:submit>
					&nbsp; &nbsp; &nbsp; <html:link href = "home.jsp" styleClass = "button" style="color:blue;">Cancel</html:link>
				</td>
			</tr>
		</table>
	</html:form>
	<%} }%>
</body>